<template>
  <div>
    <p>{{name}}</p>
    <p>{{age}}</p>
    <button @click="age++">changAge</button>
  </div>
</template>

<script>
import { reactive, toRefs } from 'vue'
export default {
  setup() {
    // 定义一个obj变量
    const obj = reactive({
      name: '董文达',
      age: 8
    })
    return {
      ...toRefs(obj)
    }
  }
}
</script>

<style>

</style>
